package com.ithuameng.notice.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 通知
 */
@Data
@TableName("t_notice")
@EqualsAndHashCode(callSuper = false)
public class Notice implements Serializable {

    private static final long serialVersionUID = -2968232732934049695L;

    public static final String STATE = "state";

    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 接收消息用户的ID/管理员
     */
    private Integer receiverId;

    /**
     * 进行操作用户的ID/会员
     */
    private Long operatorId;

    /**
     * 消息内容
     */
    private String content;

    /**
     * 消息状态 0未读 1已读
     */
    private Boolean state;

    /**
     * 发送时间
     */
    private LocalDateTime createTime;

    public Notice(Integer receiverId, Long operatorId, String content, Boolean state, LocalDateTime createTime) {
        this.receiverId = receiverId;
        this.operatorId = operatorId;
        this.content = content;
        this.state = state;
        this.createTime = createTime;
    }
}
